package www.wen.com.common.lib.extension

import android.content.Context
import android.view.View
import android.widget.Toast
import com.hjq.toast.ToastUtils
import www.wen.com.common.R
import www.wen.com.common.lib.app.BaseApplication.Companion.CONTEXT

/**
 * Created by luyao
 * on 2019/5/31 16:42
 */



fun Any.toast(content: String, duration: Int = Toast.LENGTH_SHORT,context: Context = CONTEXT) {
    ToastUtils.show(content)
}

fun View.toast(tip:String = getString(R.string.please_check_the_agreement), action:()->Unit){
    if(this.isSelected){
        action.invoke()
    }else{
        toast(tip)
    }
}


